<%@ page pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title><fmt:message key="flightInfoList.title"/></title> 
<script src="<c:url value='/scripts/common.js'/>"></script> 

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link rel="stylesheet" type="text/css" media="all"	href="<c:url value='/styles/layout.css'/>" />
</head>
<script src="<c:url value="/scripts/date.js"/>" language="javascript"></script>
<body leftmargin="0" topmargin="0">
<html:form action="flightInfo" styleId="flightInfoForm">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="home-content-title"><img src="images/home_ico_listTitle.gif" width="22" height="20" align="absmiddle"> 航班信息查询</td>
  </tr>
  <tr>
    <td width="100%" height="40" class="home-search-space">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr height="30" class="home-search-space">
	<td align="right" nowrap>进出港选择：</td>
	<td nowrap>
	<html:select name="flightInfoForm" property="port" size="1" styleId="port" styleClass="home-table-inputbox">
	  <html:option  value="">全部</html:option>
	  <html:option  value="1">进港</html:option><!-- 终点站是深圳 -->
	  <html:option  value="2">出港</html:option><!-- 始发站是深圳 --> 
	</html:select>
	</td>
	<!-- 
	<td align=right>航站：</td>
	<td>
	<select style="width:80px" class="home-table-inputbox">
	<option>&nbsp;</option>
	<option value="SZX">深圳</option>
	<option value="BJ">北京</option>
	</select>
	</td>
	-->
	<td align="right">&nbsp;</td>
	<td>&nbsp;</td>
	
	<td align="right" nowrap>航班号： </td>
	<td>
	<html:text property="flightNum" styleClass="home-table-inputbox" size="10" maxlength="7"/>
	</td>
    <td align="right" nowrap>日期：</td>
    <td nowrap>
    <html:text property="flightDate" styleId="flightDate" styleClass="home-table-inputbox" size="10" maxlength="10"/>
    &nbsp;<img src="images/date.gif" width="16" height="15" onclick="fPopCalendar(flightDate,flightDate);return false"/>
    </td>
	<td align="right" nowrap>距航班起飞：</td>
	<td>
	<html:select name="flightInfoForm" property="lessEtd" size="1" styleId="lessEtd" styleClass="home-table-inputbox">
	  <html:option  value="">&nbsp;</html:option>
	  <html:option  value="1">小于1小时</html:option>
	  <html:option  value="2">小于2小时</html:option>
	  <html:option  value="3">小于3小时</html:option>
	  <html:option  value="4">小于4小时</html:option>
	  <html:option  value="5">小于5小时</html:option>
	</html:select>
	</td>
	</tr>

	<tr height="30" class="home-search-space">
	<td align=right>始发站：</td>
	  <%-- <td><select style="width:80px" class="home-table-inputbox"><option></option><option value="SZX">深圳</option><option value="BJ">北京</option></select></td> --%>
      <td>
			<html:select name="flightInfoForm" property="departureAirport" size="1" styleId="vipTypeId" style="width:80px" >
			  <html:option  value="">&nbsp;</html:option> 
			  <html:options collection="cityInfo"  property="code" labelProperty="name"/> 
			</html:select></td>
    
     <td align=right nowrap>终点站：</td>
       <td>
			<html:select name="flightInfoForm" property="arrivalAirport" size="1" styleId="vipTypeId" style="width:80px" >
			  <html:option  value="">&nbsp;</html:option> 
			  <html:options collection="cityInfo" property="code" labelProperty="name"/> 
			</html:select></td>
    
     <%-- <td><select style="width:80px" class="home-table-inputbox"><option></option><option value="SZX">深圳</option><option value="BJ">北京</option></select></td>--%>
      	
     <td align=right nowrap>延误时间分类：</td>
       <td>
		<html:select name="flightInfoForm" property="moreStd" size="1" styleId="moreStd" styleClass="home-table-inputbox">
		  <html:option  value="">&nbsp;</html:option>
		  <html:option  value="1">1小时以上</html:option>
		  <html:option  value="2">2小时以上</html:option>
		  <html:option  value="3">3小时以上</html:option>
		  <html:option  value="4">4小时以上</html:option>
		  <html:option  value="5">5小时以上</html:option>
		  <html:option  value="6">6小时以上</html:option>
		  <html:option  value="7">7小时以上</html:option>
		  <html:option  value="8">8小时以上</html:option>
	     </html:select>
		</td>
		<td colspan="3" nowrap>
		<html:checkbox property="needFood" value="1">需提供餐食</html:checkbox>
		<html:checkbox property="needHotel" value="1">需安排住宿</html:checkbox>
		<html:checkbox property="needCompensation" value="1">需补偿</html:checkbox>
		</td>
      	<td><input type="button" class="home-inputBtn" name="Submit232" value="查询" onclick="javascript:flightSearch();"></td>
	</tr>
	</table>
  </tr>
           <tr> 
          <td class="home-table-topline"> </td>
        </tr>
        <tr> 
          <td class="home-table-leftline"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-tool-content02"><sasis:page items="${flightInfoList}"/></td>
              </tr>
              <tr> 
                <td align="center" valign="top" class="home-edittable-space">	
		          <table width="100%" border="0" cellpadding="2" cellspacing="0" class="list_bordercolor">
                    <tr height=30> 
                      <td width="5%" height="28" class="home-list-title">航班号</td>
                      <td width="7%" class="home-list-title">日期</td>
                      <td width="3%" class="home-list-title">机型</td>
                      <td width="3%" class="home-list-title">机号</td>
                      <td width="5%" class="home-list-title">始发站</td>
                      <td width="5%" class="home-list-title">登机口</td>
                      <td width="4%" class="home-list-title">登机</td>
                      <td width="4%" class="home-list-title">计飞</td>
                      <td width="4%" class="home-list-title">预飞</td>
                      <td width="4%" class="home-list-title">实飞</td>
                      <td width="5%" class="home-list-title">终点站</td>
                      <td width="5%" class="home-list-title">计达</td>
                      <td width="5%" class="home-list-title">预达</td>
                      <td width="5%" class="home-list-title">实达</td>
                      <td width="5%" class="home-list-title">公务舱人数</td>
                      <td width="5%" class="home-list-title">经济舱人数</td>
                      <td width="5%" class="home-list-title">总人数</td>
                 <!--   
                    <td width="5%" nowrap class="home-list-title">高端旅客</td>
                      <td width="5%" nowrap class="home-list-title">中转旅客</td>
                      <td width="5%" nowrap class="home-list-title">调整发布</td>
                      <td width="5%" nowrap class="home-list-title">通知记录</td>
                      <td width="5%" nowrap class="home-list-title">签转记录</td>
					  <td width="5%" nowrap class="home-list-title">保护记录</td>
                      <td width="5%" nowrap class="home-list-title">内部延误原因</td>
                      <td width="5%" nowrap class="home-list-title">登机口记录</td>
                --> 
                    </tr>
                    <c:forEach var="results" items="${flightInfoList}" varStatus="status">
                     <tr height=25>
                      <%-- <td class="home-list-content">&nbsp;<c:out value="${results.flightNum}"/></td> --%>
                      <td class="home-list-content">&nbsp;<c:if test="${results.id!=null}"><a href="flightInfo.html?method=view&id=<c:out value='${results.id}'/>"><c:out value="${results.flightNum}"/></a></c:if>
                      <c:if test="${results.id==null}" ><c:out value="${results.flightNum}"/></c:if>
                       </td>
                      <td class="home-list-content">&nbsp;<fmt:formatDate value="${results.flightDate}" pattern="yyyy-MM-dd"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.acType}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.acReg}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.dan}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.onBoardGate}"/></td>
                      <td class="home-list-content">&nbsp;<fmt:formatDate value="${results.onBoardTime}" pattern="HH:mm"/></td>
                      <td class="home-list-content">&nbsp;<fmt:formatDate value="${results.std}" pattern="HH:mm"/> </td>
                      <td class="home-list-content">&nbsp;<fmt:formatDate value="${results.etd}" pattern="HH:mm"/></td>
                      <td class="home-list-content">&nbsp;<fmt:formatDate value="${results.atd}" pattern="HH:mm"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.aan}"/></td>
                      <td class="home-list-content">&nbsp;<fmt:formatDate value="${results.sta}" pattern="HH:mm"/></td>
                      <td class="home-list-content">&nbsp;<fmt:formatDate value="${results.eta}" pattern="HH:mm"/></td>
                      
                      <td class="home-list-content">&nbsp;<fmt:formatDate value="${results.ata}" pattern="HH:mm"/></td>
                      <td class="home-list-content"><a href="passengerInfo.html?flightInfoId=<c:out value='${results.id}'/>&cabinClass=Y&direct=flightCheck&direct1=flightCheck1">&nbsp;<c:out value="${results.econNum}"/></a></td>
                      <td class="home-list-content"><a href="passengerInfo.html?flightInfoId=<c:out value='${results.id}'/>&cabinClass=C&direct=flightCheck">&nbsp;<c:out value="${results.passagerNum}"/></a></td>
                      <td class="home-list-content"><a href="passengerInfo.html?flightInfoId=<c:out value='${results.id}'/>&direct=flightCheck">&nbsp;<c:out value="${results.passagerTotal}"/></a></td>
                    <!-- 
                      <td class="home-list-content"><a href="psgInfo_vip.html">&nbsp;3</a></td>
                      <td class="home-list-content"><a href="psgInfo_transfer.html">&nbsp;3</a></td>
                      <td class="home-list-content"><a href="flightadjustnew.html">&nbsp;<img src="images/update.gif" width="12" height="14" border=0 /></a></td>
                      <td class="home-list-content"><a href="abnormalpsg_notify.html">&nbsp;<img src="images/view.gif" width="12" height="14" border=0 /></a></td>
                      <td class="home-list-content"><a href="psgadjust_new.html">&nbsp;<img src="images/view.gif" width="12" height="14" border=0 /></a></td>
					  <td class="home-list-content"><a href="abnormalpsg_protect.html">&nbsp;<img src="images/view.gif" width="12" height="14" border=0 /></a></td>
                      <td class="home-list-content"><a href="delayreason.html">&nbsp;<img src="images/view.gif" width="12" height="14" border=0 /></a></td>
                      <td class="home-list-content"><a href="boardinggate.html">&nbsp;<img src="images/view.gif" width="12" height="14" border=0 /></a></td>
                     -->
                    </tr>
		</c:forEach> 
                  </table>
                </td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td height="12"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-bottom-left">&nbsp;</td>
                <td class="home-table-bottom-bg">&nbsp;</td>
                <td class="home-table-bottom-right">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
 

  <tr> 
    <td height="10">&nbsp;</td>
  </tr>
</table>
</html:form>
</body>
<script>
//written by kellen 07-04-19
function doDelete(chkName){  
		var selected = new Array(); 
		var val = "";	  
		   for (var i=0;i < document.forms[0].elements.length; i++){
				var e = document.forms[0].elements[i];  
				if (e.name==chkName){
					var chk = document.forms[0].elements[i];
					if(chk.checked){
						var bb = e.value; 
					    	selected.push(bb);
					    	break;
					} 
				}	 
			}	 
 		if(0!=selected.length){
 			if(confirm("<fmt:message key="common.confirm.message"/>")){  
				document.forms[0].method="post";
				document.forms[0].action="./flightInfo.html?method=delete";
				document.forms[0].submit();
			}else return;	  			
		}else{
			alert("<fmt:message key="common.delete.message"/>");
		}	 
	}
	
function flightSearch(){
    //alert("come search");
    var starTimeTxt=document.getElementById("flightDate");
    var starTime="";
    if(starTimeTxt!=null)starTime=starTimeTxt.value;
    //这里是判断YYYY-MM-DD这种格式的，基本上把闰年和2月等的情况都考虑进去了
    var reg=/^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$/;
	var result=true;
	//alert(starTime);
	if(starTime!=null&&starTime!="")result=reg.test(starTime);
	//alert("result="+reg.test(starTimeTxt.value));
	if(result){
	     //alert(result);
	     //将需要验证的ID传入数组
		var propertyArray = new Array();
		propertyArray.push("flightNum");
		//alert(propertyArray.length)
		//把验证数组传入验证特殊字符函数
		result=checkSpecialInput(propertyArray);
	    if(result==true||result==null)
	     flightInfoForm.submit();
	    else alert(result);
	     
	}else{
	    alert("日期格式不正确，应该类似为:2007-09-10");
	}
}
</script>
</html> 
<td class="home-list-content">
                         <a href="passengerInfo.html?flightInfoId=<c:out value='${results.id}'/>&cabinClass=C" style="color: red"></a></td>
                      <td class="home-list-content">
                       